import Cookies from 'js-cookie';

const TokenKey = 'Admin-Token';

export function setToken(token) {
    return Cookies.set(TokenKey, token, {
        expires: 7, // 7天后过期
        secure: true, // 仅 HTTPS 传输
        sameSite: 'strict' // 防止 CSRF
    });
}

export function getToken() {
    return Cookies.get(TokenKey);
}

export function removeToken() {
    return Cookies.remove(TokenKey);
}